@include('admin.common.header')

<!--tab nav start-->
<section class="panel">
    <header class="panel-heading tab-bg-dark-navy-blue ">
        <ul class="nav nav-tabs">
            <li @if ($_active['_action'] == 'list')  class="active" @endif>
                <a href="/admin/activity">活动列表</a>
            </li>
            <li @if ($_active['_action'] == 'copy')  class="active" @endif>
                <a href="/admin/activity/copy">复制活动</a>
            </li>

        </ul>
    </header>
    <div class="panel-body">
        <div class="tab-content">
            <div class="row cmxform form-horizontal tasi-form">
                <div class="col-lg-6">
                    <section class="panel">
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">活动标题</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="id" placeholder="" value="{{$activity->id}}" type="hidden" />
                                    <input class="form-control form-item" name="title" value="{{$activity->title}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">活动费用</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="cost" value="{{$activity->cost}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">限制人数</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="limit_of_number" value="{{$activity->limit_of_number}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">活动路线</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="route" value="{{$activity->route}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">出发地</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="set_out" value="{{$activity->set_out}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">目的地</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="destination" value="{{$activity->destination}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">时长</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="duration"  value="{{$activity->duration}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">活动类型</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="type" value="{{$activity->type}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">活动强度</label>
                                <div class="col-lg-10">
                                    <div class="star1"></div>
                                    <input class="form-control form-item" name="strength" value="{{$activity->strength}}" type="hidden" id="strength" />
                                    {{--<input id="strength" name="strength" value="4" type="text" class="rating form-control form-item"  required title="">--}}
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">风景指数</label>
                                <div class="col-lg-10">
                                    <div class="star2"></div>
                                    <input class="form-control form-item" name="view_index" value="{{$activity->view_index}}"type="hidden" id="view_index" />
                                    {{--<input id="view_index" name="view_index" value="4" type="text" class="rating form-control form-item"  required title="">--}}
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">集合时间</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" id="collection_time" value="{{$activity->collection_time}}" name="collection_time" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">集合地点</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" id="collection_place" value="{{$activity->collection_place}}" name="collection_place" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">排序</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" name="sort"  value="{{$activity->sort}}" placeholder="" type="text" value="0" />
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
                <div class="col-lg-6">
                    <section class="panel">
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">上线时间</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" id="on_line_time" value="{{$activity->on_line_time}}" name="on_line_time" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">下线时间</label>
                                <div class="col-lg-10">
                                    <input class="form-control form-item" id="off_line_time" name="off_line_time" value="{{$activity->off_line_time}}" placeholder="" type="text" />
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">活动分类</label>
                                <div class="col-lg-10">
                                    <select class=" form-control form-item" name="class_id">
                                        @foreach($class as $a)
                                            <option value="{{$a->id}}">{{$a->classname}}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form-group ">
                                <label for="name" class="control-label col-lg-2">选择用户</label>
                                <div class="col-lg-10">
                                    <select class=" form-control form-item" name="user_id">
                                        @foreach($user as $a)
                                            <option value="{{$a->id}}">{{$a->name}}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="form">
                                <div class="form-group ">
                                    <div class="col-lg-12">
                                        <!-- D&D Zone-->
                                        <div id="drag-and-drop-zone" class="uploader">
                                            <div>上传图片</div>
                                            <div>将图片拖拽到此处</div>
                                            <div class="or">-或者-</div>
                                            <div class="browser">
                                                <label>
                                                    <span>点击上传图片</span>
                                                    <input type="file" name="imgs[]" multiple="multiple" title='Click to add Files'>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="panel panel-default">
                                            <div class="panel-heading">
                                                <h3 class="panel-title">Uploads</h3>
                                            </div>
                                            <div class="panel-body demo-panel-files" id='demo-files'>
                                                <div style="overflow: hidden;float: left;height: 186px;margin: 15px 0;" class="col-lg-3" id="demo-file0">
                                                    <div class="remove"><i class="icon-remove"></i></div>
                                                    <img class="goods-imgs" id="img-0" style="width: 100%;height:100%;" src="{{ $activity->img }}">
                                                    <div style="position: absolute;top: 50%;margin-left: -15px;z-index: 100;" class="col-lg-12">
                                                        <div style="background: #000;text-align: center;color: #fff">
                                                            <i class="icon-ok-sign"></i>上传成功
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
            <div class="col-lg-12 text-center">
                <button class="btn btn-danger form-submit" type="button">提交</button>
            </div>
        </div>
    </div>
</section>
<!--tab nav start-->

<script>
    require(['app/activitycopy', 'common/uploadImg', 'libs/layDate-v5.0.9/laydate/laydate', 'libs/jquery.raty'] , function (activitycopy, uploadImg, layerDate) {
        activitycopy.ajaxCopyActivity();
        uploadImg.upImg(1);
        uploadImg.removeImg();
        layerDate.render({
            elem: '#on_line_time'
            ,type: 'datetime'
        });

        layerDate.render({
            elem: '#off_line_time'
            ,type: 'datetime'
        });

        layerDate.render({
            elem: '#collection_time'
            ,type: 'datetime'
        });

        $('.star1').raty({
            hints: ['1', '2', '3', '4', '5'],
            number:5,
            path: "/css/img",
            starOff: 'star-off-big.png',
            starOn: 'star-on-big.png',
            size: 35,
            start: 3,
            score:{{$activity->strength}},
            showHalf: true,
            target: "#strength",
            targetKeep : true,//targetKeep 属性设置为true，用户的选择值才会被保持在目标DIV中，否则只是鼠标悬停时有值，而鼠标离开后这个值就会消失
            click: function (score, evt) {
                console.log(score);
            }
        });

        $('.star2').raty({
            hints: ['1', '2', '3', '4', '5'],
            number:5,
            path: "/css/img",
            starOff: 'star-off-big.png',
            starOn: 'star-on-big.png',
            size: 35,
            score:{{$activity->view_index}},
            start: 3,
            showHalf: true,
            target: "#view_index",
            targetKeep : true,//targetKeep 属性设置为true，用户的选择值才会被保持在目标DIV中，否则只是鼠标悬停时有值，而鼠标离开后这个值就会消失
            click: function (score, evt) {
                console.log(score);
            }
        });
    });
</script>
@include('admin.common.footer')